﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace CSharpBot
{
    public static class RandomBot
    {
        static readonly string botName = "RandomBot";
        private static string clock = "japan";
        private struct n
        {
            public static int Tokyo = 248;
        };

        public static void init()
        {
            Console.Title = "C# " + botName + " is up and running!";

            Console.Write("[");
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write(botName);
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write("] ");
            Console.WriteLine();
        randomRestart:
            Console.Write("Command: ");
            Console.ForegroundColor = ConsoleColor.Magenta;
            string command = Console.ReadLine();
            Console.ForegroundColor = ConsoleColor.Gray;

            string[] arguments = command.Split(' ');
            if (arguments.Length > 0)
            {
                if (arguments[0] == "help")
                    help();
                if (arguments[0] == "time")
                    Console.WriteLine(getTimeFrom(n.Tokyo));

                    /*if (!string.IsNullOrEmpty(arguments[1]))
                    {
                        if (arguments[1] == "tokyo")
                            getTimeFrom(n.Tokyo);
                        else
                            getTimeFrom(0);
                    }
                    else
                    {
                        Console.WriteLine("Error not enough arguments!");
                    }*/
                if (arguments[0] == "exit")
                    Environment.Exit(0);
            }
            goto randomRestart;
        }

        private static void help()
        {

        }

        private static string getTimeFrom(int PlaceNameNumber)
        {
            if (PlaceNameNumber == 0)
            {
                Console.WriteLine("Can't get the time from this place.");
            }
            else
            {
                
            }

            return "";
        }
    }
}
